package edu.pku.sei.transformation.atl.adapter;

import edu.pku.sei.transformation.atl.rule.IATLExpression;
import edu.pku.sei.transformation.atl.rule.IATLLink;
import edu.pku.sei.transformation.atl.rule.IATLNode;
import edu.pku.sei.transformation.editor.model.variable.ConnectionVariable;

public class ATLLinkAdapter implements IATLLink, IATLExpression {
	ConnectionVariable connection = null;
	IATLNode source = null;
	IATLNode target = null;

	ATLLinkAdapter(ConnectionVariable connection, IATLNode source,
			IATLNode target) {
		this.connection = connection;
		this.target = target;
	}

	@Override
	public String getName() {
		return connection.getTargetRole();
	}

	@Override
	public IATLNode getTarget() {
		return target;
	}

	@Override
	public String getContent() {
		return source.getName() + "." + connection + "=" + target.getName()
				+ ";";
	}

}
